package defpackage; import android.app.Activity; import android.content.Context; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import cn.wps.moffice.framework.util.SoftKeyboardUtil; import cn.wps.moffice.main.local.filebrowser.search.assistant.AssistantSearchActivity; import cn.wps.moffice.main.local.filebrowser.search.home.SearchActivity; import cn.wps.moffice_eng.R; import com.google.firebase.analytics.FirebaseAnalytics; import defpackage.ghu; /* renamed from: gjk reason: default package */ public final class gjk extends ght { String cpr; private ghu heF; private View hfh; String hfi; String hfj; private String hfk; private boolean hfl; int hfm; private final String hfn = "https://edu-m.wps.cn/free_video/search?from=wps_android_search&search_word="; private final String hfo = "https://edu-m.wps.cn/free_video/main/null?from=1"; Context mContext; View mRootView; private TextView qN; public gjk(Context context) { this.mContext = context; } @Override // defpackage.ght public final void a(ghu ghu) { this.heF = ghu; } @Override // defpackage.ght public final View d(ViewGroup viewGroup) { if (this.mRootView == null) { this.mRootView = LayoutInflater.from(this.mContext).inflate(R.layout.public_phone_doc_search_bottom_item, viewGroup, false); this.qN = (TextView) this.mRootView.findViewById(R.id.bottom_text); this.hfh = this.mRootView.findViewById(R.id.bottom_divider); } this.hfi = ""; this.hfj = ""; this.cpr = ""; this.hfl = false; if (this.heF != null) { if (this.heF.extras != null) { for (ghu.a aVar : this.heF.extras) { if ("bottom".equals(aVar.key)) { this.hfi = (String) aVar.value; } else if ("jump".equals(aVar.key)) { this.hfj = (String) aVar.value; } else if ("keyword".equals(aVar.key)) { this.cpr = (String) aVar.value; } else if ("hasBottomDivider".equals(aVar.key)) { this.hfk = (String) aVar.value; } else if ("fulltext_bottom".equals(aVar.key)) { if (!TextUtils.isEmpty((String) aVar.value)) { this.hfl = true; } else { this.hfl = false; } } else if ("jump_to".equals(aVar.key)) { this.hfm = ((Integer) aVar.value).intValue(); } } } if (TextUtils.isEmpty(this.hfk)) { this.hfh.setVisibility(0); } else { this.hfh.setVisibility(8); } if (this.hfl) { this.hfh.setVisibility(8); } if (TextUtils.isEmpty(this.hfi)) { this.qN.setVisibility(8); } else { this.qN.setVisibility(0); this.qN.setText(this.hfi); } this.qN.setOnClickListener(new View.OnClickListener() { /* class defpackage.gjk.AnonymousClass1 */ public final void onClick(View view) { if (TextUtils.isEmpty(gjk.this.hfi)) { return; } if ("jump_doc".equals(gjk.this.hfj)) { dwp.km("public_totalsearchresult_docmore_click"); SoftKeyboardUtil.aB(gjk.this.mRootView); fvf.a(gjk.this.mContext, true, gjk.this.cpr); } else if ("jump_model".equals(gjk.this.hfj)) { dwp.km("public_totalsearchresult_templatemore_click"); SoftKeyboardUtil.aB(gjk.this.mRootView); gec.a(gjk.this.mContext, gjk.this.cpr, 0, "from_more"); } else if ("jump_assistant".equals(gjk.this.hfj)) { gec.vx("public_totalsearchresult_helpcard_more_click"); gec.x(gjk.this.mContext, gjk.this.cpr, null); } else if ("jump_feedback".equals(gjk.this.hfj)) { gec.vx("public_helpsearchresult_more_click"); fvf.cY(gjk.this.mContext); } else if ("jump_wps_skill".equals(gjk.this.hfj)) { String str = gjk.this.mContext instanceof SearchActivity ? FirebaseAnalytics.Event.SEARCH : gjk.this.mContext instanceof AssistantSearchActivity ? "helpsearch" : ""; switch (gjk.this.hfm) { case 0: gjt.h((Activity) gjk.this.mContext, "https://edu-m.wps.cn/free_video/main/null?from=1", str); return; case 1: gjt.h((Activity) gjk.this.mContext, "https://edu-m.wps.cn/free_video/search?from=wps_android_search&search_word=" + gjk.this.cpr, str); return; default: return; } } } }); } return this.mRootView; } }